<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <!--<meta name="viewport" content="width=device-width, initial-scale=1.0">-->
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>青蛇探针在线SSH-登录🐍</title>
    <link rel="stylesheet" href="style.css">
    <script src="/admin/js/jquery-3.1.1.min.js"></script>
</head>

<body>
    <div class="container">
        <form method="POST" action="/submit" class="login-form">
            <h2>🐍青蛇探针WEB-SSH 客户端</h2>
            <input id="ip" type="text" name="host" placeholder="服务器IP" />
            <input id="port" type="number" name="port" value="22" placeholder="SSH端口(port)" />
            <input id="username" type="text" name="username" placeholder="用户名(root)" />
            <input id="password" type="password" name="userpassword" placeholder="服务器密码">
            <button type="submit">登录</button>
        </form>
    </div>
</body>
<script>
    $(function () {
        //获取地址栏参数，name:参数名称
        function getUrlParms(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null)
                return unescape(r[2]);
            return null;
        }
        var username = getUrlParms("username");
        var password = getUrlParms("password");
        var ip = getUrlParms("ip");
        if(ip){
            $("#ip").val(ip)
        }
        if(username){
            $("#username").val(username)
        }
        if(password){
            $("#password").val(password)
        }
        $("#port").val(22)
    })
</script>

</html>